<?php


namespace App\Models\Garbage;
use App\Models\Api\Files;
use App\Models\CarModels\CarCity;
use Illuminate\Database\Eloquent\Model;


class GarbageGoodInfo extends Model
{

    protected $table = 'garbage_good_infos';
    protected $fillable = ['garbage_good_kind_id','name','city_id','price','point','desc','on_sale','file_id','store'];

    public function files(){
        return $this->belongsTo(Files::class,'file_id');
    }
    public function kind(){
        return $this->belongsTo(GarbageGoodKind::class,'garbage_good_kind_id');
    }

    public function city(){
        return $this->belongsTo(CarCity::class,'city_id');
    }

    public function exchanges()
    {
        return $this->hasMany(GarbageGoodPurchase::class,'good_id');
    }



}